home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / Tie::SubstrHash.z / Tie::SubstrHash
Encoding:
Text File  |  1998-10-30  |  2.1 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TTTTiiiieeee::::::::SSSSuuuubbbbssssttttrrrrHHHHaaaasssshhhh((((3333))))                                          TTTTiiiieeee::::::::SSSSuuuubbbbssssttttrrrrHHHHaaaasssshhhh((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tie::SubstrHash - Fixed-table-size, fixed-key-length hashing
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.          require Tie::SubstrHash;
  13.  
  14.          tie %myhash, 'Tie::SubstrHash', $key_len, $value_len, $table_size;
  15.  
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      The TTTTiiiieeee::::::::SSSSuuuubbbbssssttttrrrrHHHHaaaasssshhhh package provides a hash-table-like interface to an
  19.      array of determinate size, with constant key size and record size.
  20.  
  21.      Upon tying a new hash to this package, the developer must specify the
  22.      size of the keys that will be used, the size of the value fields that the
  23.      keys will index, and the size of the overall table (in terms of key-value
  24.      pairs, not size in hard memory). _T_h_e_s_e _v_a_l_u_e_s _w_i_l_l _n_o_t _c_h_a_n_g_e _f_o_r _t_h_e
  25.      _d_u_r_a_t_i_o_n _o_f _t_h_e _t_i_e_d _h_a_s_h. The newly-allocated hash table may now have
  26.      data stored and retrieved. Efforts to store more than $table_size
  27.      elements will result in a fatal error, as will efforts to store a value
  28.      not exactly $value_len characters in length, or reference through a key
  29.      not exactly $key_len characters in length. While these constraints may
  30.      seem excessive, the result is a hash table using much less internal
  31.      memory than an equivalent freely-allocated hash table.
  32.  
  33. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  34.      Because the current implementation uses the table and key sizes for the
  35.      hashing algorithm, there is no means by which to dynamically change the
  36.      value of any of the initialization parameters.
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.